/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.Util;

import org.richfaces.model.UploadedFile;

/**
 *
 * @author Fellipe
 */
public class Arquivo{
    
    private String contentType;
    private byte[] data;
    private String name;
    private long size;
    private String extension;

    public Arquivo(UploadedFile file) {
        this.name = file.getName();
        this.size = file.getSize();
        this.contentType = file.getContentType();
        this.data = file.getData();
        this.extension = name.substring(name.lastIndexOf(".") + 1);
    }
    
    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public byte[] getData() {
        return data;
    }

    public void setData(byte[] data) {
        this.data = data;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public String getExtension() {
        return extension;
    }

    public void setExtension(String extension) {
        this.extension = extension;
    }
    
}
